//
//  NSString+JsonKit.m
//  pickpic
//
//  Created by GaoYongyue on 16/10/2.
//  Copyright © 2016年 MicroDream. All rights reserved.
//

#import "NSString+JsonKit.h"

@implementation NSString(JsonKit)
- (id)cd_objectFromJSONString
{
    if (!self.length) return nil;

    NSError* error = nil;
    NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding];
    id result = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
    if(error !=nil)
    {
        return nil;
    }

    return result;
}


@end
